const path = require('path');

const pathStr1 = '/aa//bb//cc/index.html';

console.log(path.basename(pathStr1));//index.html
console.log(path.basename(pathStr1, '.html'));//index
console.log(path.extname(pathStr1));//.html
console.log(path.dirname(pathStr1));//  /aa//bb//cc

console.log('isAbsolute', path.isAbsolute(pathStr1));//isAbsolute true


console.log('normalize', path.normalize(pathStr1));//normalize \aa\bb\cc\index.html
console.log('resolve', path.resolve(pathStr2, pathStr1));//resolve E:\aa\bb\cc\index.html
console.log('parse', path.parse(pathStr1));